package mysgoog.bot;

import java.util.*;

public class ValuedMap extends HashMap<Integer, ValuedPos>
{
    private static final long serialVersionUID = 1L;

    public ValuedPos add(Integer key, double value)
    {
        ValuedPos res = super.get(key);
        if (res == null)
        {
            res = new ValuedPos(key, 0);
            super.put(key, res);
        }
        res.val += value;
        return res;
    }
}
